﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LabManagement.Data.DataUtilities
{
    public class OrgUtils:BaseDataUtils
    {
        public OrgUtils(DataManager bridge) : base(bridge) { }

        public IEnumerable<Org> Orgs(Guid? OrgId = null, int? pageNo = null, int? pagesize = null)
        {
            var _orgs = this.Bridge.DataFactory.Orgs.OrderBy(l => l.OrgName);
            if (OrgId.HasValue)
            {
                _orgs = this.Bridge.DataFactory.Orgs.Where(l => l.OrgId == OrgId).OrderBy(c => c.OrgName);
                return _orgs;
            }
            return _orgs;
        }
    }
}
